package com.ugoodtech.mdcc.core.model.mapper;

import com.ugoodtech.mdcc.core.model.entity.StationReport;
import com.ugoodtech.mdcc.core.model.entity.StationReportExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface StationReportMapper {
    @SelectProvider(type=StationReportSqlProvider.class, method="countByExample")
    int countByExample(StationReportExample example);

    @DeleteProvider(type=StationReportSqlProvider.class, method="deleteByExample")
    int deleteByExample(StationReportExample example);

    @Delete({
        "delete from station_report",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    @Insert({
        "insert into station_report (id, creation_time, ",
        "deleted, enabled, update_time, ",
        "admin_readed, audit_note, ",
        "auditing, category, ",
        "contact_user, deparmentIds, ",
        "end_service_time, exception_type, ",
        "improvement_time, is_followed, ",
        "re_audit, report_category, ",
        "report_type, score, ",
        "service_type_id, specified_type, ",
        "start_service_time, temporary_station_id, ",
        "user_ids, station_id, ",
        "user_id, answer_other, ",
        "is_supplement, type, ",
        "edit_user_id, userType)",
        "values (#{id,jdbcType=BIGINT}, #{creationTime,jdbcType=TIMESTAMP}, ",
        "#{deleted,jdbcType=BIT}, #{enabled,jdbcType=BIT}, #{updateTime,jdbcType=TIMESTAMP}, ",
        "#{adminReaded,jdbcType=BIT}, #{auditNote,jdbcType=VARCHAR}, ",
        "#{auditing,jdbcType=VARCHAR}, #{category,jdbcType=VARCHAR}, ",
        "#{contactUser,jdbcType=VARCHAR}, #{deparmentids,jdbcType=VARCHAR}, ",
        "#{endServiceTime,jdbcType=TIMESTAMP}, #{exceptionType,jdbcType=VARCHAR}, ",
        "#{improvementTime,jdbcType=BIGINT}, #{isFollowed,jdbcType=BIT}, ",
        "#{reAudit,jdbcType=BIT}, #{reportCategory,jdbcType=VARCHAR}, ",
        "#{reportType,jdbcType=VARCHAR}, #{score,jdbcType=INTEGER}, ",
        "#{serviceTypeId,jdbcType=VARCHAR}, #{specifiedType,jdbcType=VARCHAR}, ",
        "#{startServiceTime,jdbcType=TIMESTAMP}, #{temporaryStationId,jdbcType=BIGINT}, ",
        "#{userIds,jdbcType=VARCHAR}, #{stationId,jdbcType=BIGINT}, ",
        "#{userId,jdbcType=BIGINT}, #{answerOther,jdbcType=VARCHAR}, ",
        "#{isSupplement,jdbcType=BIT}, #{type,jdbcType=VARCHAR}, ",
        "#{editUserId,jdbcType=BIGINT}, #{usertype,jdbcType=INTEGER})"
    })
    int insert(StationReport record);

    @InsertProvider(type=StationReportSqlProvider.class, method="insertSelective")
    int insertSelective(StationReport record);

    @SelectProvider(type=StationReportSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="creation_time", property="creationTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="deleted", property="deleted", jdbcType=JdbcType.BIT),
        @Result(column="enabled", property="enabled", jdbcType=JdbcType.BIT),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="admin_readed", property="adminReaded", jdbcType=JdbcType.BIT),
        @Result(column="audit_note", property="auditNote", jdbcType=JdbcType.VARCHAR),
        @Result(column="auditing", property="auditing", jdbcType=JdbcType.VARCHAR),
        @Result(column="category", property="category", jdbcType=JdbcType.VARCHAR),
        @Result(column="contact_user", property="contactUser", jdbcType=JdbcType.VARCHAR),
        @Result(column="deparmentIds", property="deparmentids", jdbcType=JdbcType.VARCHAR),
        @Result(column="end_service_time", property="endServiceTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="exception_type", property="exceptionType", jdbcType=JdbcType.VARCHAR),
        @Result(column="improvement_time", property="improvementTime", jdbcType=JdbcType.BIGINT),
        @Result(column="is_followed", property="isFollowed", jdbcType=JdbcType.BIT),
        @Result(column="re_audit", property="reAudit", jdbcType=JdbcType.BIT),
        @Result(column="report_category", property="reportCategory", jdbcType=JdbcType.VARCHAR),
        @Result(column="report_type", property="reportType", jdbcType=JdbcType.VARCHAR),
        @Result(column="score", property="score", jdbcType=JdbcType.INTEGER),
        @Result(column="service_type_id", property="serviceTypeId", jdbcType=JdbcType.VARCHAR),
        @Result(column="specified_type", property="specifiedType", jdbcType=JdbcType.VARCHAR),
        @Result(column="start_service_time", property="startServiceTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="temporary_station_id", property="temporaryStationId", jdbcType=JdbcType.BIGINT),
        @Result(column="user_ids", property="userIds", jdbcType=JdbcType.VARCHAR),
        @Result(column="station_id", property="stationId", jdbcType=JdbcType.BIGINT),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
        @Result(column="answer_other", property="answerOther", jdbcType=JdbcType.VARCHAR),
        @Result(column="is_supplement", property="isSupplement", jdbcType=JdbcType.BIT),
        @Result(column="type", property="type", jdbcType=JdbcType.VARCHAR),
        @Result(column="edit_user_id", property="editUserId", jdbcType=JdbcType.BIGINT),
        @Result(column="userType", property="usertype", jdbcType=JdbcType.INTEGER)
    })
    List<StationReport> selectByExample(StationReportExample example);

    @Select({
        "select",
        "id, creation_time, deleted, enabled, update_time, admin_readed, audit_note, ",
        "auditing, category, contact_user, deparmentIds, end_service_time, exception_type, ",
        "improvement_time, is_followed, re_audit, report_category, report_type, score, ",
        "service_type_id, specified_type, start_service_time, temporary_station_id, user_ids, ",
        "station_id, user_id, answer_other, is_supplement, type, edit_user_id, userType",
        "from station_report",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="creation_time", property="creationTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="deleted", property="deleted", jdbcType=JdbcType.BIT),
        @Result(column="enabled", property="enabled", jdbcType=JdbcType.BIT),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="admin_readed", property="adminReaded", jdbcType=JdbcType.BIT),
        @Result(column="audit_note", property="auditNote", jdbcType=JdbcType.VARCHAR),
        @Result(column="auditing", property="auditing", jdbcType=JdbcType.VARCHAR),
        @Result(column="category", property="category", jdbcType=JdbcType.VARCHAR),
        @Result(column="contact_user", property="contactUser", jdbcType=JdbcType.VARCHAR),
        @Result(column="deparmentIds", property="deparmentids", jdbcType=JdbcType.VARCHAR),
        @Result(column="end_service_time", property="endServiceTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="exception_type", property="exceptionType", jdbcType=JdbcType.VARCHAR),
        @Result(column="improvement_time", property="improvementTime", jdbcType=JdbcType.BIGINT),
        @Result(column="is_followed", property="isFollowed", jdbcType=JdbcType.BIT),
        @Result(column="re_audit", property="reAudit", jdbcType=JdbcType.BIT),
        @Result(column="report_category", property="reportCategory", jdbcType=JdbcType.VARCHAR),
        @Result(column="report_type", property="reportType", jdbcType=JdbcType.VARCHAR),
        @Result(column="score", property="score", jdbcType=JdbcType.INTEGER),
        @Result(column="service_type_id", property="serviceTypeId", jdbcType=JdbcType.VARCHAR),
        @Result(column="specified_type", property="specifiedType", jdbcType=JdbcType.VARCHAR),
        @Result(column="start_service_time", property="startServiceTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="temporary_station_id", property="temporaryStationId", jdbcType=JdbcType.BIGINT),
        @Result(column="user_ids", property="userIds", jdbcType=JdbcType.VARCHAR),
        @Result(column="station_id", property="stationId", jdbcType=JdbcType.BIGINT),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
        @Result(column="answer_other", property="answerOther", jdbcType=JdbcType.VARCHAR),
        @Result(column="is_supplement", property="isSupplement", jdbcType=JdbcType.BIT),
        @Result(column="type", property="type", jdbcType=JdbcType.VARCHAR),
        @Result(column="edit_user_id", property="editUserId", jdbcType=JdbcType.BIGINT),
        @Result(column="userType", property="usertype", jdbcType=JdbcType.INTEGER)
    })
    StationReport selectByPrimaryKey(Long id);

    @UpdateProvider(type=StationReportSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") StationReport record, @Param("example") StationReportExample example);

    @UpdateProvider(type=StationReportSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") StationReport record, @Param("example") StationReportExample example);

    @UpdateProvider(type=StationReportSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(StationReport record);

    @Update({
        "update station_report",
        "set creation_time = #{creationTime,jdbcType=TIMESTAMP},",
          "deleted = #{deleted,jdbcType=BIT},",
          "enabled = #{enabled,jdbcType=BIT},",
          "update_time = #{updateTime,jdbcType=TIMESTAMP},",
          "admin_readed = #{adminReaded,jdbcType=BIT},",
          "audit_note = #{auditNote,jdbcType=VARCHAR},",
          "auditing = #{auditing,jdbcType=VARCHAR},",
          "category = #{category,jdbcType=VARCHAR},",
          "contact_user = #{contactUser,jdbcType=VARCHAR},",
          "deparmentIds = #{deparmentids,jdbcType=VARCHAR},",
          "end_service_time = #{endServiceTime,jdbcType=TIMESTAMP},",
          "exception_type = #{exceptionType,jdbcType=VARCHAR},",
          "improvement_time = #{improvementTime,jdbcType=BIGINT},",
          "is_followed = #{isFollowed,jdbcType=BIT},",
          "re_audit = #{reAudit,jdbcType=BIT},",
          "report_category = #{reportCategory,jdbcType=VARCHAR},",
          "report_type = #{reportType,jdbcType=VARCHAR},",
          "score = #{score,jdbcType=INTEGER},",
          "service_type_id = #{serviceTypeId,jdbcType=VARCHAR},",
          "specified_type = #{specifiedType,jdbcType=VARCHAR},",
          "start_service_time = #{startServiceTime,jdbcType=TIMESTAMP},",
          "temporary_station_id = #{temporaryStationId,jdbcType=BIGINT},",
          "user_ids = #{userIds,jdbcType=VARCHAR},",
          "station_id = #{stationId,jdbcType=BIGINT},",
          "user_id = #{userId,jdbcType=BIGINT},",
          "answer_other = #{answerOther,jdbcType=VARCHAR},",
          "is_supplement = #{isSupplement,jdbcType=BIT},",
          "type = #{type,jdbcType=VARCHAR},",
          "edit_user_id = #{editUserId,jdbcType=BIGINT},",
          "userType = #{usertype,jdbcType=INTEGER}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(StationReport record);
}